package com.hxzy.tms.tools;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
/**
 * 用户信息过滤类
 * @author team1
 *
 */
public class InfoFilter {
    public static String userJsonFilter(String str, Long time) {
        str = str.replace("username", "姓名");
        str = str.replace("email", "邮箱");
        str = str.replace("phone", "手机号");
        str = str.replace("realname", "真实姓名");
        str = str.replace("nickname", "昵称");
        str = str.replace("gmtLogin", "上次登录时间");
        return userTimerFilter(str, time);
    }

    public static String userTimerFilter(String str, Long time) {
        DateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH/mm/ss");
        String strtime = sdf2.format(time);
        str = str.replace(time+"", "\""+strtime+"\"");
        return str;
    }
}